// 定义flex等分
@for $i from 0 through 12 {
	.t-flex-#{$i} {
		flex: $i;
	}
}

// 定义字体(rpx)单位，大于或等于20的都为rpx单位字体
@for $i from 20 through 40 {
	.t-font-#{$i} {
		font-size: $i + rpx;
	}
}

// 定义内外边距，历遍1-80
@for $i from 0 through 80 {
	// 只要双数和能被5除尽的数
	@if $i % 2 == 0 or $i % 5 == 0 {
		// 得出：t-margin-30或者t-m-30
		.t-margin-#{$i}, .t-m-#{$i} {
			margin: $i + rpx!important;
		}
		
		// 得出：t-padding-30或者t-p-30
		.t-padding-#{$i}, .t-p-#{$i} {
			padding: $i + rpx!important;
		}
		
		@each $short, $long in l left, t top, r right, b bottom {
			// 缩写版，结果如： t-m-l-30
			// 定义外边距
			.t-m-#{$short}-#{$i} {
				margin-#{$long}: $i + rpx!important;
			}
			
			// 定义内边距
			.t-p-#{$short}-#{$i} {
				padding-#{$long}: $i + rpx!important;
			}
			
			// 完整版，结果如：t-margin-left-30
			// 定义外边距
			.t-margin-#{$long}-#{$i} {
				margin-#{$long}: $i + rpx!important;
			}
			
			// 定义内边距
			.t-padding-#{$long}-#{$i} {
				padding-#{$long}: $i + rpx!important;
			}
		}
	}
}

.t-flex {
	/* #ifndef APP-NVUE */
	display: flex;
	/* #endif */
	flex-direction: row;
	align-items: center;
}

.t-relative,
.t-rela {
	position: relative;
}

.t-absolute,
.t-abso {
	position: absolute;
}

.t-flex-wrap {
	flex-wrap: wrap;
}

.t-flex-nowrap {
	flex-wrap: nowrap;
}

.t-col-center {
	align-items: center;
}

.t-col-top {
	align-items: flex-start;
}

.t-col-bottom {
	align-items: flex-end;
}

.t-row-center {
	justify-content: center;
}

.t-row-left {
	justify-content: flex-start;
}

.t-row-right {
	justify-content: flex-end;
}

.t-row-between {
	justify-content: space-between;
}

.t-row-around {
	justify-content: space-around;
}

.t-text-left {
	text-align: left;
}

.t-text-center {
	text-align: center;
}

.t-text-right {
	text-align: right;
}

/*只显几行*/
@for $i from 1 through 4 {
	.t-show-#{$i}-line{
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: $i;
		overflow: hidden;
	}
}

/*flex布局水平居右*/
.t-flex-right{
	margin-left: auto;
}

/*flex普通*/
.t-flex-row{
	display: flex;
}

/*字体加粗*/
.t-weight-font{
	font-weight: bold;
}

/*不换行*/
.t-nowarps{
	white-space: nowrap;
}

/*数字，字母换行*/
.t-break-all{
	word-break: break-all;
	white-space: normal;
}
